#!/usr/bin/perl -w
use CGI::Carp qw(fatalsToBrowser);
use lib 'module';
use Dauphin;
$dauphin = Dauphin->new(

### required fields

    main_table     => 'people',
    key_field      => 'id',
    display_fields => [ 'firstname', 'lastname', 'phone','state' ],
    config_file    => 'database_config.cgi',
    search_fields => [ 'firstname', 'lastname' ],

### optional 'lookups' HoH: lookups from a field in this table to 
### a field in an external table

    lookups => {    
        state => {    

            # connect to this table
            table => 'states',

            # select this column, plus remote_key
            label => 'longname',

            # will match this value in their key
            key => 'id'
        }
      },
### optional 'links' AoH: lookups of the primary key of this table to 
### a field in an external table, via a joining table

    links => [
        {
            field_name => 'degrees',
            type       => 'multiple',

            external_table => {
                name          => 'degrees',
                key_field     => 'id',
                label_fields => [ 'degree' ]
            },
            joining_table => {
                name         => 'people_degrees',
                left_column  => 'person',
                right_column => 'degree'
            }
        }
    ],

); # end new()

$dauphin->run();

